<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Main Map</title>
<script type="text/javascript">
    var baseUrl = 'https://bankall.googlecode.com/svn/trunk/';
	var BankColor = "red";
	var ButtonColor = "red";
	var CloseButtonImg = "red-cross.png";
	var imagePosition = 4;
	var BankName = 'Sabb Bank';
	var totalBranches = 0;
</script>
<script language="javascript" type="text/javascript" src="https://bankall.googlecode.com/svn/trunk/jquery-1.7.1.js"></script>
<script language="javascript" type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true"></script>
<script language="javascript" type="text/javascript">
    function MarkerClusterer(a,b,c){this.extend(MarkerClusterer,google.maps.OverlayView);this.map_=a;this.markers_=[];this.clusters_=[];this.sizes=[53,56,66,78,90];this.styles_=[];this.ready_=false;var d=c||{};this.gridSize_=d["gridSize"]||60;this.minClusterSize_=d["minimumClusterSize"]||2;this.maxZoom_=d["maxZoom"]||null;this.styles_=d["styles"]||[];this.imagePath_=d["imagePath"]||this.MARKER_CLUSTER_IMAGE_PATH_;this.imageExtension_=d["imageExtension"]||this.MARKER_CLUSTER_IMAGE_EXTENSION_;this.zoomOnClick_=true;if(d["zoomOnClick"]!=undefined){this.zoomOnClick_=d["zoomOnClick"]}this.averageCenter_=false;if(d["averageCenter"]!=undefined){this.averageCenter_=d["averageCenter"]}this.setupStyles_();this.setMap(a);this.prevZoom_=this.map_.getZoom();var e=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var a=e.map_.getZoom();if(e.prevZoom_!=a){e.prevZoom_=a;e.resetViewport()}});google.maps.event.addListener(this.map_,"idle",function(){e.redraw()});if(b&&b.length){this.addMarkers(b,false)}}function Cluster(a){this.markerClusterer_=a;this.map_=a.getMap();this.gridSize_=a.getGridSize();this.minClusterSize_=a.getMinClusterSize();this.averageCenter_=a.isAverageCenter();this.center_=null;this.markers_=[];this.bounds_=null;this.clusterIcon_=new ClusterIcon(this,a.getStyles(),a.getGridSize())}function ClusterIcon(a,b,c){a.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView);this.styles_=b;this.padding_=c||0;this.cluster_=a;this.center_=null;this.map_=a.getMap();this.div_=null;this.sums_=null;this.visible_=false;this.setMap(this.map_)}MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/"+"images/m";MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png";MarkerClusterer.prototype.extend=function(a,b){return function(a){for(var b in a.prototype){this.prototype[b]=a.prototype[b]}return this}.apply(a,[b])};MarkerClusterer.prototype.onAdd=function(){this.setReady_(true)};MarkerClusterer.prototype.draw=function(){};MarkerClusterer.prototype.setupStyles_=function(){if(this.styles_.length){return}for(var a=0,b;b=this.sizes[a];a++){this.styles_.push({url:this.imagePath_+(a+1)+"."+this.imageExtension_,height:b,width:b})}};MarkerClusterer.prototype.fitMapToMarkers=function(){var a=this.getMarkers();var b=new google.maps.LatLngBounds;for(var c=0,d;d=a[c];c++){b.extend(d.getPosition())}this.map_.fitBounds(b)};MarkerClusterer.prototype.setStyles=function(a){this.styles_=a};MarkerClusterer.prototype.getStyles=function(){return this.styles_};MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_};MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_};MarkerClusterer.prototype.getMarkers=function(){return this.markers_};MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length};MarkerClusterer.prototype.setMaxZoom=function(a){this.maxZoom_=a};MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_};MarkerClusterer.prototype.calculator_=function(a,b){var c=0;var d=a.length;var e=d;while(e!==0){e=parseInt(e/10,10);c++}c=Math.min(c,b);return{text:d,index:c}};MarkerClusterer.prototype.setCalculator=function(a){this.calculator_=a};MarkerClusterer.prototype.getCalculator=function(){return this.calculator_};MarkerClusterer.prototype.addMarkers=function(a,b){for(var c=0,d;d=a[c];c++){this.pushMarkerTo_(d)}if(!b){this.redraw()}};MarkerClusterer.prototype.pushMarkerTo_=function(a){a.isAdded=false;if(a["draggable"]){var b=this;google.maps.event.addListener(a,"dragend",function(){a.isAdded=false;b.repaint()})}this.markers_.push(a)};MarkerClusterer.prototype.addMarker=function(a,b){this.pushMarkerTo_(a);if(!b){this.redraw()}};MarkerClusterer.prototype.removeMarker_=function(a){var b=-1;if(this.markers_.indexOf){b=this.markers_.indexOf(a)}else{for(var c=0,d;d=this.markers_[c];c++){if(d==a){b=c;break}}}if(b==-1){return false}a.setMap(null);this.markers_.splice(b,1);return true};MarkerClusterer.prototype.removeMarker=function(a,b){var c=this.removeMarker_(a);if(!b&&c){this.resetViewport();this.redraw();return true}else{return false}};MarkerClusterer.prototype.removeMarkers=function(a,b){var c=false;for(var d=0,e;e=a[d];d++){var f=this.removeMarker_(e);c=c||f}if(!b&&c){this.resetViewport();this.redraw();return true}};MarkerClusterer.prototype.setReady_=function(a){if(!this.ready_){this.ready_=a;this.createClusters_()}};MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length};MarkerClusterer.prototype.getMap=function(){return this.map_};MarkerClusterer.prototype.setMap=function(a){this.map_=a};MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_};MarkerClusterer.prototype.setGridSize=function(a){this.gridSize_=a};MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_};MarkerClusterer.prototype.setMinClusterSize=function(a){this.minClusterSize_=a};MarkerClusterer.prototype.getExtendedBounds=function(a){var b=this.getProjection();var c=new google.maps.LatLng(a.getNorthEast().lat(),a.getNorthEast().lng());var d=new google.maps.LatLng(a.getSouthWest().lat(),a.getSouthWest().lng());var e=b.fromLatLngToDivPixel(c);e.x+=this.gridSize_;e.y-=this.gridSize_;var f=b.fromLatLngToDivPixel(d);f.x-=this.gridSize_;f.y+=this.gridSize_;var g=b.fromDivPixelToLatLng(e);var h=b.fromDivPixelToLatLng(f);a.extend(g);a.extend(h);return a};MarkerClusterer.prototype.isMarkerInBounds_=function(a,b){return b.contains(a.getPosition())};MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(true);this.markers_=[]};MarkerClusterer.prototype.resetViewport=function(a){for(var b=0,c;c=this.clusters_[b];b++){c.remove()}for(var b=0,d;d=this.markers_[b];b++){d.isAdded=false;if(a){d.setMap(null)}}this.clusters_=[]};MarkerClusterer.prototype.repaint=function(){var a=this.clusters_.slice();this.clusters_.length=0;this.resetViewport();this.redraw();window.setTimeout(function(){for(var b=0,c;c=a[b];b++){c.remove()}},0)};MarkerClusterer.prototype.redraw=function(){this.createClusters_()};MarkerClusterer.prototype.distanceBetweenPoints_=function(a,b){if(!a||!b){return 0}var c=6371;var d=(b.lat()-a.lat())*Math.PI/180;var e=(b.lng()-a.lng())*Math.PI/180;var f=Math.sin(d/2)*Math.sin(d/2)+Math.cos(a.lat()*Math.PI/180)*Math.cos(b.lat()*Math.PI/180)*Math.sin(e/2)*Math.sin(e/2);var g=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));var h=c*g;return h};MarkerClusterer.prototype.addToClosestCluster_=function(a){var b=4e4;var c=null;var d=a.getPosition();for(var e=0,f;f=this.clusters_[e];e++){var g=f.getCenter();if(g){var h=this.distanceBetweenPoints_(g,a.getPosition());if(h<b){b=h;c=f}}}if(c&&c.isMarkerInClusterBounds(a)){c.addMarker(a)}else{var f=new Cluster(this);f.addMarker(a);this.clusters_.push(f)}};MarkerClusterer.prototype.createClusters_=function(){if(!this.ready_){return}var a=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast());var b=this.getExtendedBounds(a);for(var c=0,d;d=this.markers_[c];c++){if(!d.isAdded&&this.isMarkerInBounds_(d,b)){this.addToClosestCluster_(d)}}};Cluster.prototype.isMarkerAlreadyAdded=function(a){if(this.markers_.indexOf){return this.markers_.indexOf(a)!=-1}else{for(var b=0,c;c=this.markers_[b];b++){if(c==a){return true}}}return false};Cluster.prototype.addMarker=function(a){if(this.isMarkerAlreadyAdded(a)){return false}if(!this.center_){this.center_=a.getPosition();this.calculateBounds_()}else{if(this.averageCenter_){var b=this.markers_.length+1;var c=(this.center_.lat()*(b-1)+a.getPosition().lat())/b;var d=(this.center_.lng()*(b-1)+a.getPosition().lng())/b;this.center_=new google.maps.LatLng(c,d);this.calculateBounds_()}}a.isAdded=true;this.markers_.push(a);var e=this.markers_.length;if(e<this.minClusterSize_&&a.getMap()!=this.map_){a.setMap(this.map_)}if(e==this.minClusterSize_){for(var f=0;f<e;f++){this.markers_[f].setMap(null)}}if(e>=this.minClusterSize_){a.setMap(null)}this.updateIcon();return true};Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_};Cluster.prototype.getBounds=function(){var a=new google.maps.LatLngBounds(this.center_,this.center_);var b=this.getMarkers();for(var c=0,d;d=b[c];c++){a.extend(d.getPosition())}return a};Cluster.prototype.remove=function(){this.clusterIcon_.remove();this.markers_.length=0;delete this.markers_};Cluster.prototype.getSize=function(){return this.markers_.length};Cluster.prototype.getMarkers=function(){return this.markers_};Cluster.prototype.getCenter=function(){return this.center_};Cluster.prototype.calculateBounds_=function(){var a=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(a)};Cluster.prototype.isMarkerInClusterBounds=function(a){return this.bounds_.contains(a.getPosition())};Cluster.prototype.getMap=function(){return this.map_};Cluster.prototype.updateIcon=function(){var a=this.map_.getZoom();var b=this.markerClusterer_.getMaxZoom();if(b&&a>b){for(var c=0,d;d=this.markers_[c];c++){d.setMap(this.map_)}return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}var e=this.markerClusterer_.getStyles().length;var f=this.markerClusterer_.getCalculator()(this.markers_,e);this.clusterIcon_.setCenter(this.center_);this.clusterIcon_.setSums(f);this.clusterIcon_.show()};ClusterIcon.prototype.triggerClusterClick=function(){var a=this.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"clusterclick",this.cluster_);if(a.isZoomOnClick()){this.map_.fitBounds(this.cluster_.getBounds())}};ClusterIcon.prototype.onAdd=function(){this.div_=document.createElement("DIV");if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(a);this.div_.innerHTML=this.sums_.text}var b=this.getPanes();b.overlayMouseTarget.appendChild(this.div_);var c=this;google.maps.event.addDomListener(this.div_,"click",function(){c.triggerClusterClick()})};ClusterIcon.prototype.getPosFromLatLng_=function(a){var b=this.getProjection().fromLatLngToDivPixel(a);b.x-=parseInt(this.width_/2,10);b.y-=parseInt(this.height_/2,10);return b};ClusterIcon.prototype.draw=function(){if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.top=a.y+"px";this.div_.style.left=a.x+"px"}};ClusterIcon.prototype.hide=function(){if(this.div_){this.div_.style.display="none"}this.visible_=false};ClusterIcon.prototype.show=function(){if(this.div_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(a);this.div_.style.display=""}this.visible_=true};ClusterIcon.prototype.remove=function(){this.setMap(null)};ClusterIcon.prototype.onRemove=function(){if(this.div_&&this.div_.parentNode){this.hide();this.div_.parentNode.removeChild(this.div_);this.div_=null}};ClusterIcon.prototype.setSums=function(a){this.sums_=a;this.text_=a.text;this.index_=a.index;if(this.div_){this.div_.innerHTML=a.text}this.useStyle()};ClusterIcon.prototype.useStyle=function(){var a=Math.max(0,this.sums_.index-1);a=Math.min(this.styles_.length-1,a);var b=this.styles_[a];this.url_=b["url"];this.height_=b["height"];this.width_=b["width"];this.textColor_=b["textColor"];this.anchor_=b["anchor"];this.textSize_=b["textSize"];this.backgroundPosition_=b["backgroundPosition"]};ClusterIcon.prototype.setCenter=function(a){this.center_=a};ClusterIcon.prototype.createCss=function(a){var b=[];b.push("background-image:url("+this.url_+");");var c=this.backgroundPosition_?this.backgroundPosition_:"0 0";b.push("background-position:"+c+";");if(typeof this.anchor_==="object"){if(typeof this.anchor_[0]==="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_){b.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;")}else{b.push("height:"+this.height_+"px; line-height:"+this.height_+"px;")}if(typeof this.anchor_[1]==="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_){b.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;")}else{b.push("width:"+this.width_+"px; text-align:center;")}}else{b.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;")}var d=this.textColor_?this.textColor_:"black";var e=this.textSize_?this.textSize_:11;b.push("cursor:pointer; top:"+a.y+"px; left:"+a.x+"px; color:"+d+"; position:absolute; font-size:"+e+"px; font-family:Arial,sans-serif; font-weight:bold");return b.join("")};window["MarkerClusterer"]=MarkerClusterer;MarkerClusterer.prototype["addMarker"]=MarkerClusterer.prototype.addMarker;MarkerClusterer.prototype["addMarkers"]=MarkerClusterer.prototype.addMarkers;MarkerClusterer.prototype["clearMarkers"]=MarkerClusterer.prototype.clearMarkers;MarkerClusterer.prototype["fitMapToMarkers"]=MarkerClusterer.prototype.fitMapToMarkers;MarkerClusterer.prototype["getCalculator"]=MarkerClusterer.prototype.getCalculator;MarkerClusterer.prototype["getGridSize"]=MarkerClusterer.prototype.getGridSize;MarkerClusterer.prototype["getExtendedBounds"]=MarkerClusterer.prototype.getExtendedBounds;MarkerClusterer.prototype["getMap"]=MarkerClusterer.prototype.getMap;MarkerClusterer.prototype["getMarkers"]=MarkerClusterer.prototype.getMarkers;MarkerClusterer.prototype["getMaxZoom"]=MarkerClusterer.prototype.getMaxZoom;MarkerClusterer.prototype["getStyles"]=MarkerClusterer.prototype.getStyles;MarkerClusterer.prototype["getTotalClusters"]=MarkerClusterer.prototype.getTotalClusters;MarkerClusterer.prototype["getTotalMarkers"]=MarkerClusterer.prototype.getTotalMarkers;MarkerClusterer.prototype["redraw"]=MarkerClusterer.prototype.redraw;MarkerClusterer.prototype["removeMarker"]=MarkerClusterer.prototype.removeMarker;MarkerClusterer.prototype["removeMarkers"]=MarkerClusterer.prototype.removeMarkers;MarkerClusterer.prototype["resetViewport"]=MarkerClusterer.prototype.resetViewport;MarkerClusterer.prototype["repaint"]=MarkerClusterer.prototype.repaint;MarkerClusterer.prototype["setCalculator"]=MarkerClusterer.prototype.setCalculator;MarkerClusterer.prototype["setGridSize"]=MarkerClusterer.prototype.setGridSize;MarkerClusterer.prototype["setMaxZoom"]=MarkerClusterer.prototype.setMaxZoom;MarkerClusterer.prototype["onAdd"]=MarkerClusterer.prototype.onAdd;MarkerClusterer.prototype["draw"]=MarkerClusterer.prototype.draw;Cluster.prototype["getCenter"]=Cluster.prototype.getCenter;Cluster.prototype["getSize"]=Cluster.prototype.getSize;Cluster.prototype["getMarkers"]=Cluster.prototype.getMarkers;ClusterIcon.prototype["onAdd"]=ClusterIcon.prototype.onAdd;ClusterIcon.prototype["draw"]=ClusterIcon.prototype.draw;ClusterIcon.prototype["onRemove"]=ClusterIcon.prototype.onRemove
</script>
<script language="javascript" type="text/javascript">
    function MapObject(a){this.setValues(a);this.createMap();return this}function MarkerObject(a){this.setValues(a);this.markers_=new Array;this.content_=new Object({bubbleContent_:new Array,total:new Array});return this}function capitaliseFirstLetter(a){return a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()}MapObject.prototype=new google.maps.MVCObject;MapObject.prototype.createMap=function(){var a=new google.maps.Geocoder;this.marker=new Array;this.polyPath=new Array;if(this.maptype){if(this.maptype=="roadmap")this.maptype=google.maps.MapTypeId.ROADMAP;if(this.maptype=="satellite")this.maptype=google.maps.MapTypeId.SATELLITE;if(this.maptype=="hybrid")this.maptype=google.maps.MapTypeId.HYBRID;if(this.maptype=="terrain")this.maptype=google.maps.MapTypeId.TERRAIN}var b={zoom:this.zoom,center:this.centerPoint,mapTypeId:this.maptype,mapTypeControl:true,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,position:google.maps.ControlPosition.TOP_LEFT},scaleControl:true,scaleControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM},zoomControl:true,zoomControlOptions:{style:google.maps.ZoomControlStyle.LARGE,position:google.maps.ControlPosition.TOP_LEFT},streetViewControl:false};var c=_global.map=new google.maps.Map(this.mapElement,b);this.set("map",c)};MapObject.prototype["createMap"]=MapObject.prototype.createMap;MarkerObject.prototype=new google.maps.MVCObject;MarkerObject.prototype.createMarker=function(a){var b=this;var c=new google.maps.LatLng(a.latitude,a.longitude);var d=b.hasMarker(c);if(d==-1){var e=new google.maps.Marker({position:c,map:b.map,icon:b.createIcon(a.icon)});b.markers_.push(e);b.content_.bubbleContent_.push(b.createContent(a,b.content_.bubbleContent_.length,1));b.content_.total.push(1);b.attachClickEvent(e,b.content_.bubbleContent_.length-1)}else{b.content_.total[d]++;if(b.content_.total[d]==2){b.content_.bubbleContent_[d]=b.content_.bubbleContent_[d]+b.createContent(a,d,b.content_.total[d]);}else{b.content_.bubbleContent_[d]=b.createContent(a,d,b.content_.total[d])+b.content_.bubbleContent_[d];}b.removeClickEvent(b.markers_[d]);b.attachClickEvent(b.markers_[d],d);}};MarkerObject.prototype["createMarker"]=MarkerObject.prototype.createMarker;MarkerObject.prototype.attachClickEvent=function(a,b){var c=this;var d="<div id='content_"+b+"' class='mainBubbleClass' currentcontent = '1' maxcontent = '"+c.content_.total[b]+"'>"+c.content_.bubbleContent_[b]+"</div>";var e=new InfoBubble({shadowStyle:1,padding:0,borderRadius:8,disableAutoPan:true,hideCloseButton:false,bubbleType:"BIG_",content:d});google.maps.event.addListener(a,"click",function(){if(previousBubble)previousBubble.close();e.open(c.map,this);previousBubble=e})};MarkerObject.prototype["attachClickEvent"]=MarkerObject.prototype.attachClickEvent;MarkerObject.prototype.removeClickEvent=function(a){google.maps.event.clearListeners(a,"click")};MarkerObject.prototype["removeClickEvent"]=MarkerObject.prototype.removeClickEvent;MarkerObject.prototype.createIcon=function(a){var b=this.icon;if(a){b=a}var c=new google.maps.MarkerImage(baseUrl+""+markerIcons[imagePosition].image,null,null,null,new google.maps.Size(markerIcons[imagePosition].height,markerIcons[imagePosition].width));return c};MarkerObject.prototype["createIcon"]=MarkerObject.prototype.createIcon;MarkerObject.prototype.hasMarker=function(a){var b=this;for(var c in b.markers_){if(b.markers_[c].getPosition().lat()==a.lat()&&b.markers_[c].getPosition().lng()==a.lng())return c}return-1};MarkerObject.prototype["hasMarker"]=MarkerObject.prototype.hasMarker;MarkerObject.prototype.createContent=function(a,b,c){var d="<div id='content_"+b+"_"+c+"' ";if(c>1)d+=" style='display:none' >";else d+=">";d+="<div class='title' align='center'>"+a.branchName.toLowerCase()+"&nbsp;</div><div style='border:2px solid white;background:white;padding:1px;border-radius:5px;'>"+"<div align='center'><img src='"+a.branchImage+"' style='height:200px;width:300px;'/></div>"+"<div><span class='nameTitle'>Branch Type</span> : <span >"+a.branchType.toLowerCase()+"</span></div>";d+="</div></div>";if(c==2)d+="<div style='width:100%;height:20px;padding:5px;'><div id='prev_"+b+"' align='left' onclick=showHideContent('"+b+"','prev')  style='cursor:pointer;display:none;width:50%;float:left'><img src='"+previousButton+"' title='Previous Branch/ATM'/></div><div  id='next_"+b+"' align='right' onclick=showHideContent('"+b+"','next') style='cursor:pointer;width:50%;float:right'><img src='"+nextButton+"' title='Next Branch/ATM'/></div></div>";return d};MarkerObject.prototype["createContent"]=MarkerObject.prototype.createContent
</script>
<script language="javascript" type="text/javascript">
   function MapElement(a){this.set("options",a);this.setOptions(a)}function initialize(){if(markerClusterer){markerClusterer.clearMarkers()}_global.mapObject=new MapObject({centerPoint:new google.maps.LatLng(22.268763552489748,47.87841796875),mapElement:document.getElementById("map_section"),zoom:5,maptype:"roadmap"});_global.map=_global.mapObject.map;markerObject=new MarkerObject({icon:_global.icon,map:_global.map});createMapObjects()}function createMapObjects(){_global.inventory.layer=new MapElement({map:_global.map,query:{from:_global.inventory.LAYER_ID,select:_global.inventory.SELECT_COLUMN}});_global.inventory.layer.setSQLWhere(_global.inventory.WHERE)}function createClustering(){markerClusterer=new MarkerClusterer(_global.map,markerObject.markers_,{maxZoom:14,gridSize:60,styles:styles[0]})}function showHideContent(a,b){var c="#content_"+a;var d=$(c).attr("maxContent");var e=$(c).attr("currentContent");if(b=="next"){$("#prev_"+a).show();if(!(e+1>d)){$(c+"_"+e).hide();$(c+"_"+ ++e).show();$(c).attr("currentContent",e)}if(e+1>d){$("#next_"+a).hide()}}else{$("#next_"+a).show();if(!(e-1<1)){$(c+"_"+e).hide();$(c+"_"+ --e).show();$(c).attr("currentContent",e)}if(e-1<1){$("#prev_"+a).hide()}}}function trim(a){return a.replace(/^\s+|\s+$/g,"")}function ltrim(a){return a.replace(/^\s+/,"")}function rtrim(a){return a.replace(/\s+$/,"")}MapElement.prototype=new google.maps.MVCObject;MapElement.prototype.options_changed=function(){var a=this.get("options");this.set("map_","map"in a?a.map:null);this.set("fusionTableId","query"in a?a.query.from:"");this.set("fusionTableColumn","query"in a?a.query.select:"")};MapElement.prototype.setSQLWhere=function(a){var b=this;var c={from:this.get("fusionTableId"),select:this.get("fusionTableColumn")};var d=false;if(a!=null&&a!=undefined&&a!=""){c["where"]=a;d=true}var e="https://www.google.com/fusiontables/api/query?sql=SELECT+"+c.select+"+FROM+"+c.from+"+";if(a!=null&&a!=undefined&&a!="")e+="WHERE+"+a+"+";e+="&jsonCallback=?";$.getJSON(e,function(a){b.markersOnMap(a)})};MapElement.prototype.markersOnMap=function(a){var b=a.table.rows;var c;if(b.length){var latLngBound = new google.maps.LatLngBounds();totalBranches=0;for(i in b){if(imagePosition>5){imagePosition=0}if(b[i][0]){var latLng = b[i][0].split(',');latLngBound.extend(new google.maps.LatLng(latLng[0],latLng[1]));totalBranches++;markerObject.createMarker(InfoData(latLng[0],latLng[1],b[i][1],b[i][2],b[i][3],b[i][4],b[i][5]),imagePosition);}}createClustering();$("#error").hide();$("#loading_screen").hide();if(totalBranches){_global.map.fitBounds(latLngBound);}if(filterType=='Province'){$("#totalBranch").html(totalBranches);$("#cityBranchColumn").hide();}else{$("#totalCityBranch").html(totalBranches);$("#cityBranchColumn").show();}}else{$("#loading_screen").hide();$("#error").show();if(filterType=='Province'){$("#totalBranch").html(0);$("#cityBranchColumn").hide();}else{$("#totalCityBranch").html(0);$("#cityBranchColumn").show();}}};var InfoData=function(a,b,c,d,e,f,g){this.latitude=a;this.longitude=b;this.branchImage=c;this.branchCode=d;this.branchType=e;this.branchAddress=f;this.branchName=g;return this};var styles=[[{url:baseUrl+"images/cluster/sabb/m1.png",height:35,width:35,anchor:[10,0],textColor:"#000000",textSize:10},{url:baseUrl+"images/cluster/sabb/m2.png",height:40,width:40,anchor:[14,0],textColor:"#000000",textSize:11},{url:baseUrl+"images/cluster/sabb/m3.png",height:52,width:52,anchor:[24,0],textColor:"#000000",textSize:12},{url:baseUrl+"images/cluster/sabb/m4.png",height:62,width:62,anchor:[30,0],textColor:"#000000",textSize:13}]]
</script>
<script language="javascript" type="text/javascript">
    function InfoBubble(a){this.extend(InfoBubble,google.maps.OverlayView);this.tabs_=[];this.activeTab_=null;this.baseZIndex_=100;this.isOpen_=false;this.bubbleType=a.bubbleType;var b=a||{};if(b["backgroundColor"]==undefined){b["backgroundColor"]=this.BACKGROUND_COLOR_}if(b["borderColor"]==undefined){b["borderColor"]=BankColor}if(b["borderRadius"]==undefined){b["borderRadius"]=this.BORDER_RADIUS_}if(b["borderWidth"]==undefined){b["borderWidth"]=this.BORDER_WIDTH_}if(b["padding"]==undefined){b["padding"]=this.PADDING_}if(b["arrowPosition"]==undefined){b["arrowPosition"]=this.ARROW_POSITION_}if(b["disableAutoPan"]==undefined){b["disableAutoPan"]=false}if(b["disableAnimation"]==undefined){b["disableAnimation"]=false}if(b["minWidth"]==undefined){b["minWidth"]=this.MIN_WIDTH_}if(b["shadowStyle"]==undefined){b["shadowStyle"]=this.SHADOW_STYLE_}if(b["arrowSize"]==undefined){b["arrowSize"]=this.ARROW_SIZE_}if(b["arrowStyle"]==undefined){b["arrowStyle"]=this.ARROW_STYLE_}this.buildDom_();this.setValues(b)}window["InfoBubble"]=InfoBubble;InfoBubble.prototype.ARROW_SIZE_=15;InfoBubble.prototype.ARROW_STYLE_=0;InfoBubble.prototype.SHADOW_STYLE_=1;InfoBubble.prototype.MIN_WIDTH_=50;InfoBubble.prototype.ARROW_POSITION_=50;InfoBubble.prototype.PADDING_=10;InfoBubble.prototype.BORDER_WIDTH_=1;InfoBubble.prototype.BORDER_COLOR_="#ccc";InfoBubble.prototype.BORDER_RADIUS_=10;InfoBubble.prototype.BACKGROUND_COLOR_="#fff";InfoBubble.prototype.extend=function(a,b){return function(a){for(var b in a.prototype){this.prototype[b]=a.prototype[b]}return this}.apply(a,[b])};InfoBubble.prototype.buildDom_=function(){var a=this.bubble_=document.createElement("DIV");a.id="bubble";a.style["position"]="relative";a.style["zIndex"]=this.baseZIndex_;var b=this.tabsContainer_=document.createElement("DIV");b.style["position"]="relative";var c=this.close_=document.createElement("IMG");c.style["position"]="absolute";c.style["width"]=this.px(30);c.style["height"]=this.px(30);c.style["border"]=0;c.style["zIndex"]=this.baseZIndex_+1;c.style["cursor"]="pointer";c.src=baseUrl+"images/"+CloseButtonImg;var d=this;google.maps.event.addDomListener(c,"click",function(){d.close();google.maps.event.trigger(d,"closeclick")});var e=this.contentContainer_=document.createElement("DIV");e.style["overflowX"]="auto";e.style["overflowY"]="auto";e.style["cursor"]="default";e.style["clear"]="both";e.style["position"]="relative";var f=this.content_=document.createElement("DIV");e.appendChild(f);var g=this.arrow_=document.createElement("DIV");g.style["position"]="relative";var h=this.arrowOuter_=document.createElement("DIV");var i=this.arrowInner_=document.createElement("DIV");var j=this.getArrowSize_();h.id="outerArrow";i.id="innerArrow";h.style["position"]=i.style["position"]="absolute";h.style["left"]=i.style["left"]="50%";h.style["height"]=i.style["height"]="0";h.style["width"]=i.style["width"]="0";h.style["marginLeft"]=this.px(-j);h.style["marginLeft"]=this.px(-j);h.style["top"]=this.px(-2);h.style["borderBottomWidth"]=0;h.style["borderColor"]=BankColor;i.style["display"]="none";var k=this.bubbleShadow_=document.createElement("DIV");k.style["position"]="absolute";a.style["display"]=k.style["display"]="none";a.appendChild(this.tabsContainer_);a.appendChild(c);a.appendChild(e);g.appendChild(h);g.appendChild(i);a.appendChild(g);var l=document.createElement("style");l.setAttribute("type","text/css");this.animationName_="_ibani_"+Math.round(Math.random()*1e4);var m="."+this.animationName_+"{-webkit-animation-name:"+this.animationName_+";-webkit-animation-duration:0.5s;"+"-webkit-animation-iteration-count:1;}"+"@-webkit-keyframes "+this.animationName_+" {from {"+"-webkit-transform: scale(0)}50% {-webkit-transform: scale(1.2)}90% "+"{-webkit-transform: scale(0.95)}to {-webkit-transform: scale(1)}}";l.textContent=m;document.getElementsByTagName("head")[0].appendChild(l)};InfoBubble.prototype.setBackgroundClassName=function(a){this.set("backgroundClassName",a)};InfoBubble.prototype["setBackgroundClassName"]=InfoBubble.prototype.setBackgroundClassName;InfoBubble.prototype.backgroundClassName_changed=function(){this.content_.className=this.get("backgroundClassName")};InfoBubble.prototype["backgroundClassName_changed"]=InfoBubble.prototype.backgroundClassName_changed;InfoBubble.prototype.setTabClassName=function(a){this.set("tabClassName",a)};InfoBubble.prototype["setTabClassName"]=InfoBubble.prototype.setTabClassName;InfoBubble.prototype.tabClassName_changed=function(){this.updateTabStyles_()};InfoBubble.prototype["tabClassName_changed"]=InfoBubble.prototype.tabClassName_changed;InfoBubble.prototype.getArrowStyle_=function(){return parseInt(this.get("arrowStyle"),10)||0};InfoBubble.prototype.setArrowStyle=function(a){this.set("arrowStyle",a)};InfoBubble.prototype["setArrowStyle"]=InfoBubble.prototype.setArrowStyle;InfoBubble.prototype.arrowStyle_changed=function(){this.arrowSize_changed()};InfoBubble.prototype["arrowStyle_changed"]=InfoBubble.prototype.arrowStyle_changed;InfoBubble.prototype.getArrowSize_=function(){return parseInt(this.get("arrowSize"),10)||0};InfoBubble.prototype.setArrowSize=function(a){this.set("arrowSize",a)};InfoBubble.prototype["setArrowSize"]=InfoBubble.prototype.setArrowSize;InfoBubble.prototype.arrowSize_changed=function(){this.borderWidth_changed()};InfoBubble.prototype["arrowSize_changed"]=InfoBubble.prototype.arrowSize_changed;InfoBubble.prototype.setArrowPosition=function(a){this.set("arrowPosition",a)};InfoBubble.prototype["setArrowPosition"]=InfoBubble.prototype.setArrowPosition;InfoBubble.prototype.getArrowPosition_=function(){return parseInt(this.get("arrowPosition"),10)||0};InfoBubble.prototype.arrowPosition_changed=function(){var a=this.getArrowPosition_();this.arrowOuter_.style["left"]=this.arrowInner_.style["left"]=a+"%";this.redraw_()};InfoBubble.prototype["arrowPosition_changed"]=InfoBubble.prototype.arrowPosition_changed;InfoBubble.prototype.setZIndex=function(a){this.set("zIndex",a)};InfoBubble.prototype["setZIndex"]=InfoBubble.prototype.setZIndex;InfoBubble.prototype.getZIndex=function(){return parseInt(this.get("zIndex"),10)||this.baseZIndex_};InfoBubble.prototype.zIndex_changed=function(){var a=this.getZIndex_();this.bubble_.style["zIndex"]=this.baseZIndex_=a;this.close_.style["zIndex"]=zIndex_+1};InfoBubble.prototype["zIndex_changed"]=InfoBubble.prototype.zIndex_changed;InfoBubble.prototype.setShadowStyle=function(a){this.set("shadowStyle",a)};InfoBubble.prototype["setShadowStyle"]=InfoBubble.prototype.setShadowStyle;InfoBubble.prototype.getShadowStyle_=function(){return parseInt(this.get("shadowStyle"),10)||0};InfoBubble.prototype.shadowStyle_changed=function(){var a=this.getShadowStyle_();var b="";var c="";var d="";switch(a){case 0:b="none";break;case 1:c="40px 15px 10px rgba(33,33,33,0.3)";d="transparent";break;case 2:c="0 0 2px rgba(33,33,33,0.3)";d="rgba(33,33,33,0.35)";break}this.bubbleShadow_.style["boxShadow"]=this.bubbleShadow_.style["webkitBoxShadow"]=this.bubbleShadow_.style["MozBoxShadow"]=c;this.bubbleShadow_.style["backgroundColor"]=d;if(this.isOpen_){this.bubbleShadow_.style["display"]=b;this.draw()}};InfoBubble.prototype["shadowStyle_changed"]=InfoBubble.prototype.shadowStyle_changed;InfoBubble.prototype.showCloseButton=function(){this.set("hideCloseButton",false)};InfoBubble.prototype["showCloseButton"]=InfoBubble.prototype.showCloseButton;InfoBubble.prototype.hideCloseButton=function(){this.set("hideCloseButton",true)};InfoBubble.prototype["hideCloseButton"]=InfoBubble.prototype.hideCloseButton;InfoBubble.prototype.hideCloseButton_changed=function(){this.close_.style["display"]=this.get("hideCloseButton")?"none":""};InfoBubble.prototype["hideCloseButton_changed"]=InfoBubble.prototype.hideCloseButton_changed;InfoBubble.prototype.setBackgroundColor=function(a){if(a){this.set("backgroundColor",a)}};InfoBubble.prototype["setBackgroundColor"]=InfoBubble.prototype.setBackgroundColor;InfoBubble.prototype.backgroundColor_changed=function(){var a=this.get("backgroundColor");this.contentContainer_.style["backgroundColor"]=a;this.arrowInner_.style["borderColor"]=a+" transparent transparent";this.updateTabStyles_()};InfoBubble.prototype["backgroundColor_changed"]=InfoBubble.prototype.backgroundColor_changed;InfoBubble.prototype.setBorderColor=function(a){if(a){this.set("borderColor",a)}};InfoBubble.prototype["setBorderColor"]=InfoBubble.prototype.setBorderColor;InfoBubble.prototype.borderColor_changed=function(){var a=this.get("borderColor");var b=this.contentContainer_;var c=this.arrowOuter_;b.style["borderColor"]=a;c.style["borderColor"]=a+" transparent transparent";b.style["borderStyle"]=c.style["borderStyle"]=this.arrowInner_.style["borderStyle"]="solid";this.updateTabStyles_()};InfoBubble.prototype["borderColor_changed"]=InfoBubble.prototype.borderColor_changed;InfoBubble.prototype.setBorderRadius=function(a){this.set("borderRadius",a)};InfoBubble.prototype["setBorderRadius"]=InfoBubble.prototype.setBorderRadius;InfoBubble.prototype.getBorderRadius_=function(){return parseInt(this.get("borderRadius"),10)||0};InfoBubble.prototype.borderRadius_changed=function(){var a=this.getBorderRadius_();var b=this.getBorderWidth_();this.contentContainer_.style["borderRadius"]=this.contentContainer_.style["MozBorderRadius"]=this.contentContainer_.style["webkitBorderRadius"]=this.bubbleShadow_.style["borderRadius"]=this.bubbleShadow_.style["MozBorderRadius"]=this.bubbleShadow_.style["webkitBorderRadius"]=this.px(a);this.tabsContainer_.style["paddingLeft"]=this.tabsContainer_.style["paddingRight"]=this.px(a+b);this.redraw_()};InfoBubble.prototype["borderRadius_changed"]=InfoBubble.prototype.borderRadius_changed;InfoBubble.prototype.getBorderWidth_=function(){return parseInt(this.get("borderWidth"),10)||0};InfoBubble.prototype.setBorderWidth=function(a){this.set("borderWidth",a)};InfoBubble.prototype["setBorderWidth"]=InfoBubble.prototype.setBorderWidth;InfoBubble.prototype.borderWidth_changed=function(){var a=this.getBorderWidth_();this.contentContainer_.style["borderWidth"]=this.px(a);this.tabsContainer_.style["top"]=this.px(a);this.updateArrowStyle_();this.updateTabStyles_();this.borderRadius_changed();this.redraw_()};InfoBubble.prototype["borderWidth_changed"]=InfoBubble.prototype.borderWidth_changed;InfoBubble.prototype.updateArrowStyle_=function(){var a=this.getBorderWidth_();var b=this.getArrowSize_();var c=this.getArrowStyle_();var d=this.px(b);var e=this.px(Math.max(0,b-a));var f=this.arrowOuter_;var g=this.arrowInner_;this.arrow_.style["marginTop"]=this.px(-a);f.style["borderTopWidth"]=d;g.style["borderTopWidth"]=e;if(c==0||c==1){f.style["borderLeftWidth"]=d;g.style["borderLeftWidth"]=e}else{f.style["borderLeftWidth"]=g.style["borderLeftWidth"]=0}if(c==0||c==2){f.style["borderRightWidth"]=d;g.style["borderRightWidth"]=e}else{f.style["borderRightWidth"]=g.style["borderRightWidth"]=0}if(c<2){f.style["marginLeft"]=this.px(-b);g.style["marginLeft"]=this.px(-(b-a))}else{f.style["marginLeft"]=g.style["marginLeft"]=0}if(a==0){f.style["display"]="none"}else{f.style["display"]=""}};InfoBubble.prototype.setPadding=function(a){this.set("padding",a)};InfoBubble.prototype["setPadding"]=InfoBubble.prototype.setPadding;InfoBubble.prototype.getPadding_=function(){return parseInt(this.get("padding"),10)||0};InfoBubble.prototype.padding_changed=function(){var a=this.getPadding_();this.contentContainer_.style["padding"]=this.px(a);this.updateTabStyles_();this.redraw_()};InfoBubble.prototype["padding_changed"]=InfoBubble.prototype.padding_changed;InfoBubble.prototype.px=function(a){if(a){return a+"px"}return a};InfoBubble.prototype.addEvents_=function(){var a=["mousedown","mousemove","mouseover","mouseout","mouseup","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","dblclick","contextmenu","click"];var b=this.bubble_;this.listeners_=[];for(var c=0,d;d=a[c];c++){this.listeners_.push(google.maps.event.addDomListener(b,d,function(a){a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}}))}};InfoBubble.prototype.onAdd=function(){if(!this.bubble_){this.buildDom_()}this.addEvents_();var a=this.getPanes();if(a){a.floatPane.appendChild(this.bubble_);a.floatShadow.appendChild(this.bubbleShadow_)}};InfoBubble.prototype["onAdd"]=InfoBubble.prototype.onAdd;InfoBubble.prototype.draw=function(){var a=this.getProjection();if(!a){return}var b=this.get("position");if(!b){this.close();return}var c=0;if(this.activeTab_){c=this.activeTab_.offsetHeight}var d=this.getAnchorHeight_();var e=this.getArrowSize_();var f=this.getArrowPosition_();f=f/100;var g=a.fromLatLngToDivPixel(b);var h=this.contentContainer_.offsetWidth;var i=this.bubble_.offsetHeight;if(!h){return}var j=g.y-(i+e);if(d){j-=d}var k=g.x-h*f;this.bubble_.style["top"]=this.px(j);this.bubble_.style["left"]=this.px(k);var l=parseInt(this.get("shadowStyle"),10);switch(l){case 1:this.bubbleShadow_.style["top"]=this.px(j+c-1);this.bubbleShadow_.style["left"]=this.px(k);this.bubbleShadow_.style["width"]=this.px(h);this.bubbleShadow_.style["height"]=this.px(this.contentContainer_.offsetHeight-e);break;case 2:h=h*.8;if(d){this.bubbleShadow_.style["top"]=this.px(g.y)}else{this.bubbleShadow_.style["top"]=this.px(g.y+e)}this.bubbleShadow_.style["left"]=this.px(g.x-h*f);this.bubbleShadow_.style["width"]=this.px(h);this.bubbleShadow_.style["height"]=this.px(2);break}this.domready()};InfoBubble.prototype["draw"]=InfoBubble.prototype.draw;InfoBubble.prototype.onRemove=function(){if(this.bubble_&&this.bubble_.parentNode){this.bubble_.parentNode.removeChild(this.bubble_)}if(this.bubbleShadow_&&this.bubbleShadow_.parentNode){this.bubbleShadow_.parentNode.removeChild(this.bubbleShadow_)}for(var a=0,b;b=this.listeners_[a];a++){google.maps.event.removeListener(b)}};InfoBubble.prototype["onRemove"]=InfoBubble.prototype.onRemove;InfoBubble.prototype.isOpen=function(){return this.isOpen_};InfoBubble.prototype["isOpen"]=InfoBubble.prototype.isOpen;InfoBubble.prototype.close=function(){if(this.bubble_){this.bubble_.style["display"]="none";this.bubble_.className=this.bubble_.className.replace(this.animationName_,"")}if(this.bubbleShadow_){this.bubbleShadow_.style["display"]="none";this.bubbleShadow_.className=this.bubbleShadow_.className.replace(this.animationName_,"")}this.isOpen_=false};InfoBubble.prototype["close"]=InfoBubble.prototype.close;InfoBubble.prototype.open=function(a,b){if(a){this.setMap(a)}if(b){this.set("anchor",b);this.bindTo("anchorPoint",b);this.bindTo("position",b)}this.bubble_.style["display"]=this.bubbleShadow_.style["display"]="";var c=!!!this.get("disableAnimation");if(c){this.bubble_.className+=" "+this.animationName_;this.bubbleShadow_.className+=" "+this.animationName_}this.redraw_();this.isOpen_=true;var d=!!!this.get("disableAutoPan");if(true){var e=this;window.setTimeout(function(){e.panToView()},200)}};InfoBubble.prototype["open"]=InfoBubble.prototype.open;InfoBubble.prototype.setPosition=function(a){if(a){this.set("position",a)}};InfoBubble.prototype["setPosition"]=InfoBubble.prototype.setPosition;InfoBubble.prototype.getPosition=function(){return this.get("position")};InfoBubble.prototype["getPosition"]=InfoBubble.prototype.getPosition;InfoBubble.prototype.position_changed=function(){this.draw()};InfoBubble.prototype["position_changed"]=InfoBubble.prototype.position_changed;InfoBubble.prototype.panToView=function(){var a=this.getProjection();if(!a){return}if(!this.bubble_){return}var b=this.getAnchorHeight_();var c=this.bubble_.offsetHeight+b;var d=this.get("map");var e=d.getDiv();var f=e.offsetHeight;var g=this.getPosition();var h=a.fromLatLngToContainerPixel(d.getCenter());var i=a.fromLatLngToContainerPixel(g);var j=h.y-c;var k=f-h.y;var l=j<0;var m=0;if(l){j*=-1;m=(j+k)/2}i.y-=m;g=a.fromContainerPixelToLatLng(i);if(d.getCenter()!=g){d.panTo(g)}};InfoBubble.prototype["panToView"]=InfoBubble.prototype.panToView;InfoBubble.prototype.htmlToDocumentFragment_=function(a){a=a.replace(/^\s*([\S\s]*)\b\s*$/,"$1");var b=document.createElement("DIV");b.innerHTML=a;if(b.childNodes.length==1){return b.removeChild(b.firstChild)}else{var c=document.createDocumentFragment();while(b.firstChild){c.appendChild(b.firstChild)}return c}};InfoBubble.prototype.removeChildren_=function(a){if(!a){return}var b;while(b=a.firstChild){a.removeChild(b)}};InfoBubble.prototype.setContent=function(a){this.set("content",a)};InfoBubble.prototype["setContent"]=InfoBubble.prototype.setContent;InfoBubble.prototype.getContent=function(){return this.get("content")};InfoBubble.prototype["getContent"]=InfoBubble.prototype.getContent;InfoBubble.prototype.content_changed=function(){if(!this.content_){return}this.removeChildren_(this.content_);var a=this.getContent();if(a){if(typeof a=="string"){a=this.htmlToDocumentFragment_(a)}this.content_.appendChild(a);var b=this;var c=this.content_.getElementsByTagName("IMG");for(var d=0,e;e=c[d];d++){google.maps.event.addDomListener(e,"load",function(){b.imageLoaded_()})}google.maps.event.trigger(this,"domready")}this.redraw_()};InfoBubble.prototype["content_changed"]=InfoBubble.prototype.content_changed;InfoBubble.prototype.domready=function(){};InfoBubble.prototype["domready"]=InfoBubble.prototype.domready;InfoBubble.prototype.imageLoaded_=function(){var a=!!!this.get("disableAutoPan");this.redraw_();if(a&&(this.tabs_.length==0||this.activeTab_.index==0)){this.panToView()}};InfoBubble.prototype.updateTabStyles_=function(){if(this.tabs_&&this.tabs_.length){for(var a=0,b;b=this.tabs_[a];a++){this.setTabStyle_(b.tab)}this.activeTab_.style["zIndex"]=this.baseZIndex_;var c=this.getBorderWidth_();var d=this.getPadding_()/2;this.activeTab_.style["borderBottomWidth"]=0;this.activeTab_.style["paddingBottom"]=this.px(d+c)}};InfoBubble.prototype.setTabStyle_=function(a){var b=this.get("backgroundColor");var c=this.get("borderColor");var d=this.getBorderRadius_();var e=this.getBorderWidth_();var f=this.getPadding_();var g=this.px(-Math.max(f,d));var h=this.px(d);var i=this.baseZIndex_;if(a.index){i-=a.index}var j={cssFloat:"left",position:"relative",cursor:"pointer",backgroundColor:b,border:this.px(e)+" solid "+c,padding:this.px(5),marginRight:0,whiteSpace:"nowrap",borderRadiusTopLeft:h,MozBorderRadiusTopleft:h,webkitBorderTopLeftRadius:h,borderRadiusTopRight:h,MozBorderRadiusTopright:h,webkitBorderTopRightRadius:h,zIndex:i,display:"inline"};for(var k in j){a.style[k]=j[k]}var l=this.get("tabClassName");if(l!=undefined){a.className+=" "+l}};InfoBubble.prototype.addTabActions_=function(a){var b=this;a.listener_=google.maps.event.addDomListener(a,"click",function(){b.setTabActive_(this)})};InfoBubble.prototype.setTabActive=function(a){var b=this.tabs_[a-1];if(b){this.setTabActive_(b.tab)}};InfoBubble.prototype["setTabActive"]=InfoBubble.prototype.setTabActive;InfoBubble.prototype.setTabActive_=function(a){if(!a){this.setContent("");return}var b=this.getPadding_()/2;var c=this.getBorderWidth_();if(this.activeTab_){var d=this.activeTab_;d.style["zIndex"]=this.baseZIndex_-d.index;d.style["paddingBottom"]=this.px(6);d.style["borderBottomWidth"]=this.px(c)}a.style["zIndex"]=this.baseZIndex_;a.style["borderBottomWidth"]=0;a.style["marginBottomWidth"]="-10px";a.style["paddingBottom"]=this.px(7);this.setContent(this.tabs_[a.index].content);this.activeTab_=a;this.redraw_()};InfoBubble.prototype.setMaxWidth=function(a){this.set("maxWidth",a)};InfoBubble.prototype["setMaxWidth"]=InfoBubble.prototype.setMaxWidth;InfoBubble.prototype.maxWidth_changed=function(){this.redraw_()};InfoBubble.prototype["maxWidth_changed"]=InfoBubble.prototype.maxWidth_changed;InfoBubble.prototype.setMaxHeight=function(a){this.set("maxHeight",a)};InfoBubble.prototype["setMaxHeight"]=InfoBubble.prototype.setMaxHeight;InfoBubble.prototype.maxHeight_changed=function(){this.redraw_()};InfoBubble.prototype["maxHeight_changed"]=InfoBubble.prototype.maxHeight_changed;InfoBubble.prototype.setMinWidth=function(a){this.set("minWidth",a)};InfoBubble.prototype["setMinWidth"]=InfoBubble.prototype.setMinWidth;InfoBubble.prototype.minWidth_changed=function(){this.redraw_()};InfoBubble.prototype["minWidth_changed"]=InfoBubble.prototype.minWidth_changed;InfoBubble.prototype.setMinHeight=function(a){this.set("minHeight",a)};InfoBubble.prototype["setMinHeight"]=InfoBubble.prototype.setMinHeight;InfoBubble.prototype.minHeight_changed=function(){this.redraw_()};InfoBubble.prototype["minHeight_changed"]=InfoBubble.prototype.minHeight_changed;InfoBubble.prototype.addTab=function(a,b){var c=document.createElement("DIV");c.innerHTML=a;this.setTabStyle_(c);this.addTabActions_(c);this.tabsContainer_.appendChild(c);this.tabs_.push({label:a,content:b,tab:c});c.index=this.tabs_.length-1;c.style["zIndex"]=this.baseZIndex_-c.index;if(!this.activeTab_){this.setTabActive_(c)}c.className=c.className+" "+this.animationName_;this.redraw_()};InfoBubble.prototype["addTab"]=InfoBubble.prototype.addTab;InfoBubble.prototype.updateTab=function(a,b,c){if(!this.tabs_.length||a<0||a>=this.tabs_.length){return}var d=this.tabs_[a];if(b!=undefined){d.tab.innerHTML=d.label=b}if(c!=undefined){d.content=c}if(this.activeTab_==d.tab){this.setContent(d.content)}this.redraw_()};InfoBubble.prototype["updateTab"]=InfoBubble.prototype.updateTab;InfoBubble.prototype.removeTab=function(a){if(!this.tabs_.length||a<0||a>=this.tabs_.length){return}var b=this.tabs_[a];b.tab.parentNode.removeChild(b.tab);google.maps.event.removeListener(b.tab.listener_);this.tabs_.splice(a,1);delete b;for(var c=0,d;d=this.tabs_[c];c++){d.tab.index=c}if(b.tab==this.activeTab_){if(this.tabs_[a]){this.activeTab_=this.tabs_[a].tab}else if(this.tabs_[a-1]){this.activeTab_=this.tabs_[a-1].tab}else{this.activeTab_=undefined}this.setTabActive_(this.activeTab_)}this.redraw_()};InfoBubble.prototype["removeTab"]=InfoBubble.prototype.removeTab;InfoBubble.prototype.getElementSize_=function(a,b,c){var d=document.createElement("DIV");d.style["display"]="inline";d.style["position"]="absolute";d.style["visibility"]="hidden";if(typeof a=="string"){d.innerHTML=a}else{d.appendChild(a.cloneNode(true))}document.body.appendChild(d);var e=new google.maps.Size(d.offsetWidth,d.offsetHeight);if(b&&e.width>b){d.style["width"]=this.px(b);e=new google.maps.Size(d.offsetWidth,d.offsetHeight)}if(c&&e.height>c){d.style["height"]=this.px(c);e=new google.maps.Size(d.offsetWidth,d.offsetHeight)}document.body.removeChild(d);delete d;return e};InfoBubble.prototype.redraw_=function(){this.figureOutSize_();this.positionCloseButton_();this.draw()};InfoBubble.prototype.figureOutSize_=function(){var a=this.get("map");if(!a){return}var b=this.getPadding_();var c=this.getBorderWidth_();var d=this.getBorderRadius_();var e=this.getArrowSize_();var f=a.getDiv();var g=e*2;var h=f.offsetWidth-g;var i=f.offsetHeight-g-this.getAnchorHeight_();var j=0;var k=this.get("minWidth")||0;var l=this.get("minHeight")||0;var m=this.get("maxWidth")||0;var n=this.get("maxHeight")||0;m=Math.min(h,m);n=Math.min(i,n);var o=0;if(this.tabs_.length){for(var p=0,q;q=this.tabs_[p];p++){var r=this.getElementSize_(q.tab,m,n);var s=this.getElementSize_(q.content,m,n);if(k<r.width){k=r.width}o+=r.width;if(l<r.height){l=r.height}if(r.height>j){j=r.height}if(k<s.width){k=s.width}if(l<s.height){l=s.height}}}else{var t=this.get("content");if(typeof t=="string"){t=this.htmlToDocumentFragment_(t)}if(t){var s=this.getElementSize_(t,m,n);if(k<s.width){k=s.width}if(l<s.height){l=s.height}}}if(m){k=Math.min(k,m)}if(n){l=Math.min(l,n)}k=Math.max(k,o);if(k==o){k=k+2*b}e=e*2;k=Math.max(k,e);if(k>h){k=h}if(l>i){l=i-j}if(this.tabsContainer_){this.tabHeight_=j;this.tabsContainer_.style["width"]=this.px(o+100)}this.contentContainer_.style["width"]=this.px(k);this.contentContainer_.style["height"]=this.px(l)};InfoBubble.prototype.getAnchorHeight_=function(){var a=this.get("anchor");if(a){var b=this.get("anchorPoint");if(b){return-1*b.y}}return 0};InfoBubble.prototype.anchorPoint_changed=function(){this.draw()};InfoBubble.prototype["anchorPoint_changed"]=InfoBubble.prototype.anchorPoint_changed;InfoBubble.prototype.positionCloseButton_=function(){var a=this.getBorderRadius_();var b=this.getBorderWidth_();var c=2;var d=2;if(this.tabs_.length&&this.tabHeight_){d+=this.tabHeight_}d+=b;c+=b;var e=this.contentContainer_;if(e&&e.clientHeight<e.scrollHeight){c+=15}this.close_.style["right"]=this.px(-(Number(c)+10));this.close_.style["top"]=this.px(-(Number(d)+6));if(navigator.appName!="Netscape"){this.close_.style["right"]=this.px(c-15);this.close_.style["top"]=this.px(9)}}
</script>
<style type='text/css'>
    .title{
            background:red;
            color: white;
            font-weight:bold;
            padding:5px 0 5px 0px;
            font-size:18px;
    }
    .nameTitle{
        color:#3D77BC;
        font-weight:bold;
        display:inline;
        width:150px;
        font-size:14px;
    }
    div{
        margin-top: 2px;
    }
    .mainBubbleClass{
        width:420px;
        height:auto;
        padding:10px;
        background:red;
        position:relative;
        margin:2px;
        border-radius: 8px 8px 8px 8px;
        font-size:15px;
    }
    #loading_screen {
            position: fixed;
            z-index: 900;
            top: 0;
            width: 100%;
            height: 510px;
            background: url(https://bankall.googlecode.com/svn/trunk/images/WaitingBig.gif);
            background-color: #333;
            background-position:center; 
            opacity: .5;
            filter: alpha(opacity=40);
            margin: 0;
            padding: 0;
            border: 0;
            background-repeat: no-repeat;
     }
	  select {
	 	border:1px solid #07B6F7;
		height:30px;
	 }
</style>
<script type="text/javascript">
var browserType = [];
    jQuery.each(jQuery.browser, function(i, val) { 
      browserType.push(i); 
      browserType.push(val); 
});
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
var globalWhere = "Name = '"+BankName+"'";
var filterType = 'Province';
 var markerClusterer=null;var previousBubble=null;var previousButton=baseUrl+"images/"+ButtonColor+"_previous.png";var nextButton=baseUrl+"images/"+ButtonColor+"_next.png";var markerIcons=new Array({image:"images/Icon_1.png",height:90,width:66},{image:"images/icon_4.png",height:56,width:65},{image:"images/icon_5.png",height:36,width:60},{image:"images/icon_6.png",height:58,width:66},{image:"images/icon_7.png",height:58,width:66},{image:"images/icon_8.png",height:58,width:66});var _global=new Object({map:null,geocoder:new google.maps.Geocoder,icon:markerIcons[0],inventory:{layer:null,LAYER_ID:4033903,SELECT_COLUMN:"Location,Image,BranchCode,Type,Address,Address",WHERE:"Name = '"+BankName+"'"}});var markerObject=null;$(document).ready(function(){getSelectList('province');initialize()})   
/*----- select provices and city code -------*/
function getSelectList(containerId)
{   
	is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	var where = '';
	var province = '';
	if(containerId == 'city'){
	    province = $("#province").attr('value');
		where = {"province":province,"cityList":true,"browser":is_chrome}
		filterType = 'Province';
	} else {
		where = {"provinceList":true,"browser":is_chrome};
		filterType = 'Province';
	}
	
    $('#'+containerId).html('');
	var selectName = containerId;
	if(containerId == 'province'){
		selectName = 'Region';
	}
    var select = '<option value="">--Select '+selectName+'--</option>';
    $('#'+containerId).append(select);
	if(is_chrome){
		var url = "http://69.60.115.13/aerial/readDb.php?result=data&browser=true";
		if(containerId == 'city'){
			province = $("#province").attr('value');
			url +="&province="+province+"&cityList=true";
			filterType = 'Province';
		} else {
			url +="&provinceList=true";
			filterType = 'Province';
		}
		var xhr = new XMLHttpRequest();
		xhr.open("get",url, true);
		xhr.onload = function(data){  //instead of onreadystatechange
			$('#'+containerId).append(xhr.responseText);
			if(containerId == 'city'){
				var where = '';
				if($("#province option:selected").attr('value'))
					where = "Province = '"+$("#province option:selected").text()+"'";
				if(where)
					if(globalWhere)
						getAllData(globalWhere+" AND "+where);
					else
						getAllData(where);
				else
					getAllData(globalWhere);
			}
		};
	
		xhr.send();
	}else{
	    $.ajax({
        url : "http://69.60.115.13/aerial/readDb.php",
		type: "GET", 
        contentType: "application/json",
		dataType: 'jsonp',
		jsonp: 'result',
        data: where,
    	success: function (data) {  
			if(data.list){
				if(is_chrome)
					$('#'+containerId).append(decodeURIComponent(data.list));
				else
					$('#'+containerId).append(data.list);
			}
			if(containerId == 'city'){
				var where = '';
				if($("#province option:selected").attr('value'))
					where = "Province = '"+$("#province option:selected").text()+"'";
				if(where)
					if(globalWhere)
						getAllData(globalWhere+" AND "+where);
					else
						getAllData(where);
				else
					getAllData(globalWhere);
				
			}
		},
		error:function(        req, error      ){
         	//alert("Error");
     	},
	
   		}); 
   }
}
function getAllData(where){
	_global.inventory.WHERE = where;
	//$("#loading_screen").show();
	initialize();
}

function filterBy(type,thisone){
	if(type == 'City'){
		filterType = 'City';
		var where = '';
		if($("#province option:selected").attr('value')){
			where = "+Province+=+'"+$("#province option:selected").text()+"'";
			if($(thisone).attr('value'))
				where +="+AND+City+=+'"+$(thisone).attr('value')+"'";
		}
		if(where)
			if(globalWhere)
				getAllData(globalWhere+" AND "+where);
			else
				getAllData(where);
		else
			getAllData(globalWhere);
		
	}
	
}
/*----- select provices and city code -------*/ 
 
 function reset(){
	$("#province").attr('value','');
	$("#city").attr('value','');
	getAllData(globalWhere);
	
	
}
</script>
</head>

<body>
<div>
    <div id="loading_screen" style="visibility:hidden"></div>
	<table width="53%" border="0" bgcolor="#07B6F7">
	<tr>
	    <td>
    	<div id='map_section' style='height:540px;width:700px;'></div>
		</td>
		<td  valign="top" style="display:none">
		<table border="0" width="100%" style="font-size:14px;color:white;position: absolute; right: -918px;">
		
		<tr>
			<td>&nbsp;</td>
	</tr>
	<tbody>
  <tr>
    <td><b>Select a Region</b> </td>
  </tr>
  <tr>
    <td><select id="province" name="province" style="width:230px;" onchange="getSelectList('city')"><option value="">--Select Region--</option></select></td>
  </tr>
  <tr>
    <td><b>Select a City</b></td>
  </tr>
  <tr>
    <td><select id="city" name="city" style="width:230px;" onchange="filterBy('City',this)"><option value="">--Select City--</option></select></td>
  </tr>
  <tr>
    <td  id="error" style='color:white;font-weight:bold;display:none;min-height: 30px;'>Data not found</td>
  </tr>
  <tr >
  	<td>
		<div align="right" style="width:20%;">
  		<input type="button" onclick="reset();" value="Reset" style="margin-top:15px;cursor:pointer;border:none;border-radius:4px;background-color:#D10000;padding:7px;color:white;font-weight:bold;"/>
		</div>
	</td>
  </tr>
  
</table>
		<table style='bottom:0px;position: absolute; right: 5px;'>
			<tr>
	<td style="color:white;background-color:#D10000;border:1px solid #D10000;width:220px;padding:10px;box-shadow:2px #888888;" nowrap='nowrap'><b> Total Branch(s)(Region): <span id="totalBranch"></span></b>
			</td>
		</tr>
		
		<tr id="cityBranchColumn" style='display:none;'>
			<td style="color:white;background-color:#D10000;border:1px solid #D10000;width:220px;padding:10px;box-shadow:2px #888888;" nowrap='nowrap'><b> Total Branch(s)(city) : <span id="totalCityBranch"></span></b>
			</td>
		</tr>
		</table>
		</td>
		</tr>
		</tbody>
		</table>
</div>
</body>
</html>
